package com.ssish.saas.eccs.mapper;

import com.ssish.saas.eccs.model.SycRefcd;
import com.ssish.saas.eccs.model.SycRefcdExample;
import com.ssish.saas.eccs.model.SycRefcdKey;
import java.util.List;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.ResultMap;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update;

public interface SycRefcdMapper {
    int countByExample(SycRefcdExample example);

    int deleteByExample(SycRefcdExample example);

    @Delete({
        "delete from SYC_REFCD",
        "where REFGRP = #{refgrp,jdbcType=VARCHAR}",
          "and REFCD = #{refcd,jdbcType=VARCHAR}",
          "and MODID = #{modid,jdbcType=VARCHAR}"
    })
    int deleteByPrimaryKey(SycRefcdKey key);

    @Insert({
        "insert into SYC_REFCD (REFGRP, REFCD, ",
        "MODID, INSBY, INSDT, ",
        "UPDBY, UPDDT, ",
        "RECSTS, FDESC, SDESC, ",
        "VAR1, VAR2, VAR3, ",
        "FUNC1, FUNC2, FUNC3, ",
        "FDESC1, SDESC1, ",
        "FDESC2, SDESC2, ",
        "FDESC3, SDESC3, ",
        "FDESC4, SDESC4, ",
        "FDESC5, SDESC5, ",
        "FDESC6, SDESC6, ",
        "NOTE, NOTE1, NOTE2, ",
        "NOTE3, NOTE4, NOTE5, ",
        "NOTE6)",
        "values (#{refgrp,jdbcType=VARCHAR}, #{refcd,jdbcType=VARCHAR}, ",
        "#{modid,jdbcType=VARCHAR}, #{insby,jdbcType=VARCHAR}, #{insdt,jdbcType=TIMESTAMP}, ",
        "#{updby,jdbcType=VARCHAR}, #{upddt,jdbcType=TIMESTAMP}, ",
        "#{recsts,jdbcType=VARCHAR}, #{fdesc,jdbcType=VARCHAR}, #{sdesc,jdbcType=VARCHAR}, ",
        "#{var1,jdbcType=VARCHAR}, #{var2,jdbcType=VARCHAR}, #{var3,jdbcType=VARCHAR}, ",
        "#{func1,jdbcType=VARCHAR}, #{func2,jdbcType=VARCHAR}, #{func3,jdbcType=VARCHAR}, ",
        "#{fdesc1,jdbcType=VARCHAR}, #{sdesc1,jdbcType=VARCHAR}, ",
        "#{fdesc2,jdbcType=VARCHAR}, #{sdesc2,jdbcType=VARCHAR}, ",
        "#{fdesc3,jdbcType=VARCHAR}, #{sdesc3,jdbcType=VARCHAR}, ",
        "#{fdesc4,jdbcType=VARCHAR}, #{sdesc4,jdbcType=VARCHAR}, ",
        "#{fdesc5,jdbcType=VARCHAR}, #{sdesc5,jdbcType=VARCHAR}, ",
        "#{fdesc6,jdbcType=VARCHAR}, #{sdesc6,jdbcType=VARCHAR}, ",
        "#{note,jdbcType=VARCHAR}, #{note1,jdbcType=VARCHAR}, #{note2,jdbcType=VARCHAR}, ",
        "#{note3,jdbcType=VARCHAR}, #{note4,jdbcType=VARCHAR}, #{note5,jdbcType=VARCHAR}, ",
        "#{note6,jdbcType=VARCHAR})"
    })
    int insert(SycRefcd record);

    int insertSelective(SycRefcd record);

    List<SycRefcd> selectByExample(SycRefcdExample example);

    @Select({
        "select",
        "REFGRP, REFCD, MODID, INSBY, INSDT, UPDBY, UPDDT, RECSTS, FDESC, SDESC, VAR1, ",
        "VAR2, VAR3, FUNC1, FUNC2, FUNC3, FDESC1, SDESC1, FDESC2, SDESC2, FDESC3, SDESC3, ",
        "FDESC4, SDESC4, FDESC5, SDESC5, FDESC6, SDESC6, NOTE, NOTE1, NOTE2, NOTE3, NOTE4, ",
        "NOTE5, NOTE6",
        "from SYC_REFCD",
        "where REFGRP = #{refgrp,jdbcType=VARCHAR}",
          "and REFCD = #{refcd,jdbcType=VARCHAR}",
          "and MODID = #{modid,jdbcType=VARCHAR}"
    })
    @ResultMap("BaseResultMap")
    SycRefcd selectByPrimaryKey(SycRefcdKey key);

    int updateByExampleSelective(@Param("record") SycRefcd record, @Param("example") SycRefcdExample example);

    int updateByExample(@Param("record") SycRefcd record, @Param("example") SycRefcdExample example);

    int updateByPrimaryKeySelective(SycRefcd record);

    @Update({
        "update SYC_REFCD",
        "set INSBY = #{insby,jdbcType=VARCHAR},",
          "INSDT = #{insdt,jdbcType=TIMESTAMP},",
          "UPDBY = #{updby,jdbcType=VARCHAR},",
          "UPDDT = #{upddt,jdbcType=TIMESTAMP},",
          "RECSTS = #{recsts,jdbcType=VARCHAR},",
          "FDESC = #{fdesc,jdbcType=VARCHAR},",
          "SDESC = #{sdesc,jdbcType=VARCHAR},",
          "VAR1 = #{var1,jdbcType=VARCHAR},",
          "VAR2 = #{var2,jdbcType=VARCHAR},",
          "VAR3 = #{var3,jdbcType=VARCHAR},",
          "FUNC1 = #{func1,jdbcType=VARCHAR},",
          "FUNC2 = #{func2,jdbcType=VARCHAR},",
          "FUNC3 = #{func3,jdbcType=VARCHAR},",
          "FDESC1 = #{fdesc1,jdbcType=VARCHAR},",
          "SDESC1 = #{sdesc1,jdbcType=VARCHAR},",
          "FDESC2 = #{fdesc2,jdbcType=VARCHAR},",
          "SDESC2 = #{sdesc2,jdbcType=VARCHAR},",
          "FDESC3 = #{fdesc3,jdbcType=VARCHAR},",
          "SDESC3 = #{sdesc3,jdbcType=VARCHAR},",
          "FDESC4 = #{fdesc4,jdbcType=VARCHAR},",
          "SDESC4 = #{sdesc4,jdbcType=VARCHAR},",
          "FDESC5 = #{fdesc5,jdbcType=VARCHAR},",
          "SDESC5 = #{sdesc5,jdbcType=VARCHAR},",
          "FDESC6 = #{fdesc6,jdbcType=VARCHAR},",
          "SDESC6 = #{sdesc6,jdbcType=VARCHAR},",
          "NOTE = #{note,jdbcType=VARCHAR},",
          "NOTE1 = #{note1,jdbcType=VARCHAR},",
          "NOTE2 = #{note2,jdbcType=VARCHAR},",
          "NOTE3 = #{note3,jdbcType=VARCHAR},",
          "NOTE4 = #{note4,jdbcType=VARCHAR},",
          "NOTE5 = #{note5,jdbcType=VARCHAR},",
          "NOTE6 = #{note6,jdbcType=VARCHAR}",
        "where REFGRP = #{refgrp,jdbcType=VARCHAR}",
          "and REFCD = #{refcd,jdbcType=VARCHAR}",
          "and MODID = #{modid,jdbcType=VARCHAR}"
    })
    int updateByPrimaryKey(SycRefcd record);
}